import { Schema, model } from "mongoose";


interface ExchangeRate {
    fromCurrency: string,
    toCurrency: string,
    rate: number,
    date: Date
}

const exchangeRateSchema = new Schema<ExchangeRate>({
    fromCurrency: { type: String, required: true },
    toCurrency: { type: String, required: true },
    rate: { type: Number, required: true },
    date: { type: Date, default: Date.now },
})

export const ModelExchangeRate = model<ExchangeRate>('ExchangeRate', exchangeRateSchema)